{% extends "admin/base.html" %}
{% block mainbody %}                
    <h3>
        会员信息管理
    </h3>
    <form id="edit-profile" action="{% url 'myadmin_users_update' user.id %}" class="form-horizontal" method="post">
        {% csrf_token %}
        <fieldset>
            <legend>编辑会员信息</legend>
            <div class="control-group">
                <label class="control-label" for="input01">账号：</label>
                <div class="controls">
                    {{ user.username }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input02">真实姓名：</label>
                <div class="controls">
                    <input type="text" name="name" class="input-xlarge" id="input02" value="{{ user.name }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input03">性别：</label>
                <div class="controls">
                    <input type="radio" name="sex" class="input-xlarge" id="input03" value="1"
                    {% if user.sex == 1 %}checked{% endif %} /> 男
                    <input type="radio" name="sex" class="input-xlarge" id="input031" value="0"
                    {% if user.sex == 0 %}checked{% endif %} /> 女
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input04">地址：</label>
                <div class="controls">
                    <input type="text" name="address" class="input-xlarge" id="input04" value="{{ user.address }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input05">邮编：</label>
                <div class="controls">
                    <input type="text" name="code" class="input-xlarge" id="input05" value="{{ user.code }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input06">电话：</label>
                <div class="controls">
                    <input type="text" name="phone" class="input-xlarge" id="input06" value="{{ user.phone }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input07">email邮箱：</label>
                <div class="controls">
                    <input type="text" name="email" class="input-xlarge" id="input07" value="{{ user.email }}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">状态：</label>
                <div class="controls">
                    <input type="radio" name="state" class="input-xlarge" id="input08" value="0"
                    {% if user.state == 0 %}checked{% endif %} /> 管理员 
                    <input type="radio" name="state" class="input-xlarge" id="input081" value="1"
                    {% if user.state == 1 %}checked{% endif %} /> 启用会员
                    <input type="radio" name="state" class="input-xlarge" id="input082" value="2"
                    {% if user.state == 2 %}checked{% endif %} /> 禁用用户
                </div>
            </div>                        
            <div class="form-actions">
                <button type="submit" class="btn btn-primary">保存</button> <button type="reset" class="btn">重置</button>
            </div>
        </fieldset>
    </form>
{% endblock %}